﻿@using KL.Store.Core;
@{
    Layout = "~/Views/Shared/_LayoutBasic.cshtml"; ;
    ViewBag.Title = "AddProductToCategory";
    //Html.EnableClientValidation(false);
}
@using (Ajax.BeginForm("RemoveFromCategory", "Products", new { }, new AjaxOptions { HttpMethod = "Post" }, new { id = "RemoveFromCategory", name = "RemoveFromCategory", @class = "form-horizontal" }))
{
    <input type="hidden" name="CategoryId" value="@ViewBag.CategoryId" />
    <input type="hidden" name="ProductId" value="@ViewBag.ProductId" />
    <input type="hidden" name="key" value="" />
    <div class="form-group">
        <div class="col-xs-12">
            <br />
            <h3>Kategoriden Ürün  Çıkarma</h3>
        </div>
    </div>
    <div class="form-group">
        <div class="col-xs-12">
            <br />
            <p><strong>@(ViewBag.ProductName)</strong> adlı ürünü <strong>@(ViewBag.CategoryName)</strong> kategorisinden çıkarmak istediğinizden emin misiniz?</p>
        </div>
    </div>
    <div class="form-group">
        <div id="formResult" class="col-xs-12">
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" class="btn btn-danger">Çıkar</button>
            <button type="button" class="btn btn-default" id="closeForm">İptal</button>
        </div>
    </div>
}
<script>
    $('#closeForm').click(function ()
    {
        parent.$.fancybox.close();
    });
    function basarili() {
        alert('Kaldırıldı.');
        //parent.location.reload(true);
    }
    function basarisiz()
    {
        $('#formResult').html('<p class="bg-danger">Bilinmeyen bir hata oluştu.</p>');
    }
</script>
